<div class="divColorbox">
    <div class="divColorbox_Header">
        <span><i class="fa fa-star"></i><span>艺人申请审批信息</span></span>
        <a class="Refresh"></a><a class="Close"></a>
    </div>
    <div class="divColorbox_Body row">
        <div>
            <input name="User_ID" type="hidden"/>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">用户ID</span>
                        <input id="User_ID" type="text" class="form-control" value="--" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">昵称</span>
                        <input id="NickName" type="text" class="form-control" disabled/>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-6">
                    <span class="input-group-addon">海报图片</span>
                    <input type="button" value="放大" onclick="$.CommonAdmin.imgToSize(50,'J_Anchor_UserCover_Img')">
                    <input type="button" value="缩小" onclick="$.CommonAdmin.imgToSize(-50,'J_Anchor_UserCover_Img')">
                    <img src="" id="J_Anchor_UserCover_Img">
                </div>
            </div>
        </div>
    </div>
    <div class="divColorbox_Footer">
        <button type="button" id="btnEdit_Agree" class="btn btn-primary">
            <i class="fa fa-check"></i> 审核通过
        </button>
        <button type="button" id="btnEdit_Disagree" class="btn btn-warning">
            <i class="fa fa-close"></i> 驳回申请
        </button>
        <button type="button" id="btnUndo"></button>
    </div>
</div>
<script>
    $(function () {
        if (_PageData.flag != 0) {
            $.KOC.Tips.Open("Error", _PageData.flag, {
                Timeout: 1000,
                onClose: function () {
                    parent.$.colorbox.close();
                }
            });
            return;
        }
        //////////////////////////////////////////////////////////
        //通过申请
        //////////////////////////////////////////////////////////
        $('#btnEdit_Agree').on('click', function () {
            var params = {};
            params.User_ID = $.trim($('#User_ID').val());
            if (!params.User_ID) {
                $.KOC.Tips.Open('Error', '数据出错请刷新', {Timeout: 2000});
                return false;
            }
            $.KOC.Loading.Open();
            $.ajax({
                url: '/ajax/user.user-anchor.anchorcovercheck',
                type: 'post',
                dataType: 'json',
                data: {
                    User_ID: params.User_ID,
                    Type: 1,
                    Status: 0
                },
                success: function (data) {
                    $.KOC.Loading.Close();
                    if (data.flag !== 0) {
                        $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 2000});
                        return;
                    }
                    $.KOC.Tips.Open('Success', '审核完成', {
                        Timeout: 1000,
                        onClose: function () {
                            parent.$.colorbox.close();
                            parent.window.location.href = "/user-manage/anchor-manage/list";
                        }
                    });
                }
            });
        });
        //////////////////////////////////////////////////////////
        //驳回申请
        //////////////////////////////////////////////////////////
        $('#btnEdit_Disagree').on('click', function () {
            var params = {};
            params.User_ID = $.trim($('#User_ID').val());
            if (!params.User_ID) {
                $.KOC.Tips.Open('Error', '数据出错请刷新', {Timeout: 2000});
                return false;
            }
            $.KOC.Loading.Open();
            $.ajax({
                url: '/ajax/user.user-anchor.anchorcovercheck',
                type: 'post',
                dataType: 'json',
                data: {
                    User_ID: params.User_ID,
                    Type: 1,
                    Status: 2
                },
                success: function (data) {
                    $.KOC.Loading.Close();
                    if (data.flag !== 0) {
                        $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 2000});
                        return;
                    }
                    $.KOC.Tips.Open('Success', '审核完成', {
                        Timeout: 1000,
                        onClose: function () {
                            parent.$.colorbox.close();
                            parent.window.location.href = "/user-manage/anchor-manage/list";
                        }
                    });
                }
            });
        });
        //////////////////////////////////////////////////////////
        //数据绑定
        //////////////////////////////////////////////////////////
        $('#User_ID').val(_PageData.User_ID);
        $('#NickName').val(_PageData.NickName);
        $('#J_Anchor_UserCover_Img').attr('src', _VirtualPath.Utils_CDN + "service/img/temp/" + _PageData.Image + '.jpg');
        switch (_PageData.Sex) {
            case 1 :
                $("#Sex").val('男');
                break;
            case 2 :
                $("#Sex").val('女');
                break;
            default:
                $('#Sex').val('');
                break;
        }
    });
</script>